<template>
  <el-container class="layout-page">
    <el-container>
      <el-header>
        <div class="logo"><img src="../assets/logo.3673fab5.png" alt="" /></div>
        <div class="user">
          <el-avatar
            :size="36"
            src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
          ></el-avatar>
          <span>欢迎您,admin</span>
        </div>
        <div class="logout">
          <!-- <el-popconfirm title="您确认退出吗？" @confirm="handleConfirm">
          <i slot="reference">退出▼</i>
        </el-popconfirm> -->
          <i @click="$router.push('/login')">退出▼</i>
        </div>
      </el-header>
      <el-main style="background-color:#f8fafd;">
        <router-view></router-view>
      </el-main>
    </el-container>
    <el-aside width="200px">
      <el-menu
        router
        :default-active="$route.path"
        background-color="#fff"
        text-color="black"
        active-text-color="black"
      >
        <el-menu-item>
          <i class="iconfont icon-home"></i>
          <span>帝可得</span>
        </el-menu-item>
        <el-menu-item>
          <el-collapse v-model="activeNames" @change="handleChange">
            <el-collapse-item name="1">
              <template slot="title">
                <i class="iconfont icon-gongdan"></i>工单管理
              </template>
              <div class="zhedie">
                <div>运营工单</div>
                <div>运维工单</div>
              </div>
            </el-collapse-item>
            <el-collapse-item name="2">
              <template slot="title">
                <i class="iconfont icon-dianweizongshu"></i>点位管理
              </template>
              <div class="zhedie">
                <div>区域管理</div>
                <div>点位管理</div>
                <div>合作商管理</div>
              </div>
            </el-collapse-item>

            <el-collapse-item name="3">
              <template slot="title">
                <i class="iconfont icon-shebei"></i>设备管理
              </template>
              <div class="zhedie">
                <div>设备管理</div>
                <div>设备状态</div>
                <div>设备类型管理</div>
              </div>
            </el-collapse-item>

            <el-collapse-item name="4">
              <template slot="title">
                <i class="iconfont icon-renyuanguanli"></i>人员管理
              </template>
              <div class="zhedie">
                <div>人员列表</div>
                <div>人效统计</div>
                <div>工作量列表</div>
              </div>
            </el-collapse-item>

            <el-collapse-item name="5">
              <template slot="title">
                <i class="iconfont icon-pintu"></i>商品管理
              </template>
              <div class="zhedie">
                <div>商品类型</div>
                <div>商品管理</div>
              </div>
            </el-collapse-item>
          </el-collapse>
          <div>
            <i class="iconfont icon-strategy"></i>
            <span>策略管理</span>
          </div>
          <div>
            <i class="iconfont icon-pingtaidingdan"></i>
            <span>订单管理</span>
          </div>
          <div>
            <i class="iconfont icon-duizhangguanli-01"></i>
            <span>对账统计</span>
          </div>
        </el-menu-item>
      </el-menu>
    </el-aside>
    <!-- <el-main>
        <router-view></router-view>
      </el-main> -->
  </el-container>
</template>

<script>
export default {
  data () {
    return {
      activeNames: ['']
    }
  },
  methods: {
    handleConfirm () {
      this.$router.push('/login')
    },
    handleChange (val) {
      console.log(val)
    }
  }
}
</script>

<style lang="scss" scoped>
 .el-main{
margin-left: 200px;
  }
.layout-page {
  height: 100vh;
  position: relative;

  .iconfont {
    color: black;
    font-size: 20px;
    font-weight: 700;
  }

  .el-aside {
    position: absolute;
    top: 40px;
    background: #fff;
    height: 100%;
    overflow: hidden;
    i {
      margin: 20px;
    }

    .el-menu {
      border-right: none;
      margin-top: 20px;
      &-item {
        background-color: transparent !important;
        > span,
        i {
          padding-left: 5px;
        }
      }
    }
    .zhedie {
      margin-left: 35px;
      color: #a0a0a0;
      div {
        margin-top: 20px;
      }
    }
  }
  .el-header {
    position: relative;
    box-shadow: 0px 0px 35px 0px rgba(154, 161, 171, 0.15);
    background: #5373e0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 999;
    .logo {
      position: absolute;
      top: 10px;
      height: 60px;
      left: 20px;
      img {
        width: 88px;
        height: 36px;
      }
    }
    .user {
      display: flex;
      align-items: center;
      background: #5373e0;
      height: 60px;
      padding: 0 15px;
      .el-avatar {
        margin-right: 15px;
      }
      span {
        color: #fff;
      }
    }
    .logout {
      font-size: 16px;
      color: #fff;
      padding: 0 15px;
    }

  }
  .el-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #aaa;
    border-top: 1px solid rgba(152, 166, 173, 0.2);
    font-size: 14px;
  }
}
::deep .el-collapse {
  border: none;
}
</style>
